document.querySelectorAll('.fileitem').forEach(elf => {
    elf.addEventListener('click', function (event) {
        if (event.target.tagName === 'INPUT') {
            if (event.target.checked) {
                querySelector('.btn-toolbar .choose').style.display = 'inline-flex'
            } else {
                if (document.querySelectorAll('.fileitem input:checked').length <= 0) {
                    querySelector('.btn-toolbar .choose').style.display = 'none'
                    querySelector('input.total').checked = false
                }
            }
            return
        }
        let el = event.target
        while (!el.dataset['path']) {
            el = el.parentNode
        }
        // false跳转
        if (!el.ariaLabel) {
            let path = el.dataset['path']
            let type = el.dataset['type']
            if (type === 'd') {
                assign(prefix + "?path=" + path)
            }
            if (type === content_type) {
                assign(prefix + "/view?path=" + path)
            }
        }
    }, false)
})